<template>
  <div class="rank-page">
    <div class="rank-page__header">
      <rank-card :data="my" />
    </div>
    <div class="rank-page__body">
      <rank-card v-for="item in list" :key="item.id" :data="item" />
    </div>
  </div>
</template>

<script>
import { getList } from './api'
import RankCard from './components/RankCard.vue'

export default {
  components: {
    RankCard
  },
  data() {
    return {
      list: [],
      loading: false,
      my: {}
    }
  },
  onLoad() {
    this.loadMore()
  },
  methods: {
    async loadMore() {
      this.loading = true
      const { top10: list, my } = await getList(this.page)
      this.my = my
      this.list = list
      this.loading = false
    }
  }
}
</script>

<style lang="less">
@import './index.less';
</style>
